include_directories (${DEPS_INCLUDE_DIRS})

add_definitions (${DEPS_CFLAGS})

link_directories (${DEPS_LIBRARY_DIRS})

set(APP_SOURCES magicom.vala window.vala serialport.vala controller.vala)

find_package (Vala REQUIRED)

vala_precompile (VALA_C magicom
    ${APP_SOURCES}
PACKAGES
	${VALA_PACKAGES} posix
OPTIONS
    --gresources=${CMAKE_SOURCE_DIR}/data/interface/magicom.gresources.xml
    --target-glib 2.38
)

add_custom_command(
    OUTPUT
        ${PROJECT_BINARY_DIR}/resources.c
    COMMAND
        glib-compile-resources
    ARGS
       ${CMAKE_SOURCE_DIR}/data/interface/magicom.gresources.xml --sourcedir=${CMAKE_SOURCE_DIR}/data/interface --target=${PROJECT_BINARY_DIR}/resources.c --generate-source
    COMMAND
        touch
    ARGS
        ${PROJECT_BINARY_DIR}/resources.c
)


add_executable(magicom ${VALA_C} ${PROJECT_BINARY_DIR}/resources.c)

target_link_libraries(magicom ${DEPS_LIBRARIES})
